<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>后台登录</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/statics/admin/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/statics/admin/css/login.css"/>
</head>

<body>
<div class="m-login-bg">
    <div class="m-login">
        <h3>后台系统登录</h3>
        <div class="m-login-warp">
            <form name="form1" class="layui-form" action="${pageContext.request.contextPath}/admin/adminLogin.do"
                  method="post">
                <div class="layui-form-item">
                    <input type="text" name="name" required lay-verify="required" placeholder="用户名" autocomplete="off"
                           class="layui-input" value="${name}">
                </div>
                <div class="layui-form-item">
                    <input type="password" name="password" required lay-verify="required" placeholder="密码"
                           autocomplete="off" class="layui-input" value="${password}">
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <input type="text" name="code" required lay-verify="required" placeholder="验证码"
                               autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-inline">
                        <img id="checkCode_img" class="verifyImg" style="width: 120px;height: 35px"
                             onclick="changeVerifyCode(this)"
                             src="${pageContext.request.contextPath}/getVerifyCode.do"/>
                    </div>
                </div>
                <div class="layui-form-item m-login-btn">
                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-normal" type="submit">登录</button>
                    </div>
                    <div class="layui-inline">
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
                <div class="layui-form-item" align="center">
                    <div class="layui-inline">
                        <p style="color: red">${msg}</p>
                    </div>
                </div>
            </form>
        </div>
        <p class="copyright"></p>
    </div>
</div>
<script src="${pageContext.request.contextPath}/statics/admin/layui/layui.js" type="text/javascript"
        charset="utf-8"></script>
<script type="text/javascript">
    function changeVerifyCode(img) {
        img.src = "${pageContext.request.contextPath}/getVerifyCode.do?" + Math.floor(Math.random() * 100)
    }
</script>
</body>

</html>